package net.exoweb.animate.actions
{
    import flash.display.DisplayObject;
    import flash.events.EventDispatcher;

    import net.exoweb.animate.events.ActionEvent;

    public class Action extends EventDispatcher
    {
        protected var _speed:Number;

        public function Action(speed:Number)
        {
            super();
            _speed = speed / 1000;
        }

        public function get speed():Number
        {
            return 1000 * _speed;
        }

        public function set speed(v:Number):void
        {
            if(v > 0) _speed = v / 1000;
            else _speed = -v / 1000;
        }

        public function complete():void
        {
            dispatchEvent(new ActionEvent(ActionEvent.ACTION_COMPLETE));
        }

        public function update(obj:DisplayObject, time:Number):void
        {
        }
    }
}
